package uk.co.accolade.clash.app;

import uk.co.accolade.clash.core.Username;

import javax.swing.*;
import java.awt.*;
import java.util.HashSet;
import java.util.Set;

public class ClashPanel extends JPanel {

    private Set<Username> users = new HashSet<Username>();

    public ClashPanel() {
        setLayout( new FlowLayout() );
        add( new JLabel("Clashed with:") );
    }

    public void showClash( Username username ) {
        users.add( username );
        add( new JLabel( username.getUsername() ) );
    }

    public Set<Username> getUsers() {
        return users;
    }
}